package com.zkthink.ceres.promotion.enums;

import lombok.Getter;

/**
 * @author 善泉 2020/6/20 16:12
 */
@Getter
public enum PromotionStatusEnum {

	NONE(0,"无状态 代表选择全部"),
	APPLY_NOT_STATED(1,"报名未开始"),
	APPLY_ING(2,"报名进行中"),
	ACTIVITY_NOT_STATED(3,"活动未开始"),
	ACTIVITY_ING(4,"活动进行中"),
	ACTIVITY_CLOSED(5,"活动已结束"),
	;

	private int code;

	private String desc;

	PromotionStatusEnum(int code, String desc){
		this.code = code;
		this.desc = desc;
	}

	public static PromotionStatusEnum getByCode(int code){
		PromotionStatusEnum[] values = PromotionStatusEnum.values();
		for(PromotionStatusEnum statusEnum:values){
			if(statusEnum.code==code){
				return statusEnum;
			}
		}
		return PromotionStatusEnum.NONE;
	}

}
